<?php
function wpboxes_widgets() {

	register_sidebar(array(
		'name'=> 'Sidebar',
		'id' => 'sidebar-widget',
		'before_widget' => '<li id="%1$s" class="sidebar-widget %2$s">',
		'after_widget' => '</li>',
		'before_title' => '<h3>',
		'after_title' => '</h3>',
	));
	
	if (wpboxes_options('wpboxes_tw') == 'show') {
	register_sidebar(array(
		'name'=> 'Top Widget',
		'id' => 'top-widget',
		'before_widget' => '<div id="%1$s" class="top-widget %2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h3>',
		'after_title' => '</h3>',
	));
	}
	if (wpboxes_options('wpboxes_apw') == 'show') {
	register_sidebar(array(
		'name'=> 'After Post Widget',
		'id' => 'after_post_widget',
		'before_widget' => '<div id="%1$s" class="afterpost-widget %2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h3>',
		'after_title' => '</h3>',
	));
	}
	
	if (wpboxes_options('wpboxes_fw') == 'show') {
	register_sidebar(array(
		'name'=> 'Footer Widget',
		'id' => 'footer-widget',
		'before_widget' => '<div id="%1$s" class="footer-widget %2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h3>',
		'after_title' => '</h3>',
	));
	}
	
	if (wpboxes_options('wpboxes_wf') == 'show') {
	register_sidebar(array(
		'name'=> 'Widgetized Footer',
		'id' => 'widgetized-footer',
		'before_widget' => '<div id="%1$s" class="widgetized-footer %2$s">',
		'after_widget' => '</div>',
		'before_title' => '<h3>',
		'after_title' => '</h3>',
	));
	}
	

}
add_action( 'widgets_init', 'wpboxes_widgets' );
?>